# -*- coding: utf-8 -*-
# created by Src - 一路好时光

import random
import string
#
# first_list = string.ascii_uppercase
# first_random = random.sample(first_list,1)
# first = "".join(first_random)
#
# second_list = "ABCDE" + string.digits
# second_random = random.sample(second_list,5)
# second = "".join(second_random)
#
# print(f"京{first}.{second}") #京I.58CD7

count = 0
while count < 3:
    car_nums = [] #存储供用户选择的号
    for i in range(20):
        #生成车牌的第一个字母
        n1 = random.choice(string.ascii_uppercase)
        #
        n2 = "".join(random.sample(string.ascii_uppercase+string.digits, 5))
        c_num = f"沪{n1}-{n2}"
        car_nums.append(c_num)
        print(i+1,c_num)

    #strip去除空格
    choice = input("输入你喜欢的号：").strip()
    if choice in car_nums:
        print(f"恭喜你选择了新车牌号：{choice}")
        exit("Good luck.")
    else:
        print("不合法的选择")
    count += 1